package com.wx.tgp.socket.demo.thread;

import java.util.Arrays;

/**
 * Created by Administrator on 2016/8/26.
 */
public class InterfaceCallbackDigestUserInterface {

    private byte[] digest;
    private String fileName;

    public InterfaceCallbackDigestUserInterface(String fileName){
        this.fileName = fileName;
    }

    public void CalculateDigest(){
        InterfaceCallbackDigest i = new InterfaceCallbackDigest(fileName,this);
        Thread t = new Thread(i);
        t.start();
    }

    public void recevierCallback(byte[] digest){
        this.digest = digest;
        System.out.println(digest.toString());
    }

    @Override
    public String toString() {
        return "InterfaceCallbackDigestUserInterface{" +
                "digest=" + Arrays.toString(digest) +
                ", fileName='" + fileName + '\'' +
                '}';
    }

    public static void main(String args[]){
        String str = "d://清单.txt";
        InterfaceCallbackDigestUserInterface i  = new InterfaceCallbackDigestUserInterface(str);
        i.CalculateDigest();;
    }
}
